﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.Entity.Core.EntityClient;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using StartDemo.DAL;

namespace StartDemo.Controllers
{
    public class AccountController : Controller
    {
      
       
        private  AccountContext db=new AccountContext();
 
   

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Login()
        {
            ViewBag.LoginState = "登录前";
            return View();
        }
        [HttpPost]
        public ActionResult Login(FormCollection fc)
        {
            string mail = fc["inputEmail3"];
            string password = fc["inputPassword3"];
            var user = db.SysUsers.Where(item => item.Email == mail & item.Password == password);
            if(user.Count()>0)
            ViewBag.LoginState = "登录后";
            else
            {
                ViewBag.LoginState = "用户不存在";

            }
            return View();
        }

        public ActionResult Register()
        {
            return View();
        }
    }
}